using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class PMS_RuleResourceNodeMap : EntityTypeConfiguration<PMS_RuleResourceNode>
	{
		public PMS_RuleResourceNodeMap()
		{
			// Primary Key
			this.HasKey(t => t.NodeId);

			// Properties
			this.Property(t => t.NodeValue)
				.HasMaxLength(50);
				
			this.Property(t => t.NodeName)
				.HasMaxLength(50);
				
			this.Property(t => t.ParentNodeValue)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("PMS_RuleResourceNode");
			this.Property(t => t.NodeId).HasColumnName("NodeId");
			this.Property(t => t.NodeValue).HasColumnName("NodeValue");
			this.Property(t => t.NodeName).HasColumnName("NodeName");
			this.Property(t => t.ParentNodeValue).HasColumnName("ParentNodeValue");
			this.Property(t => t.HasAllChildren).HasColumnName("HasAllChildren");
			this.Property(t => t.RuleId).HasColumnName("RuleId");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreateTime).HasColumnName("CreateTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
		}
	}
}

